﻿@inherits DemoWithResizableComponent

<div class="demo-description" id="NullText">
    <h2><DemoNavLink Link="TagBox#NullText" />TagBox - Null Text</h2>
    <p>
        This demo illustrates how to use the <a class="helplink" target="_blank" href="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxTagBox-2.NullText">NullText</a> property to display
        placeholder text in the <a class="helplink" target="_blank" href="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxTagBox-2">TagBox</a> when its value is null.
    </p>
    <p>
        Set the <a class="helplink" target="_blank" href="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxTagBox-2.ClearButtonDisplayMode">ClearButtonDisplayMode</a> property to <b>Auto</b> to display the <b>Clear</b> button when the
        TagBox has a non-null value. Users can click this button to clear the editor's value (set it to null).
    </p>
</div>

<div class="card demo-card demo-card-shadow">
    <div class="card-header">
        <DemoToolbar @bind-SelectedSize="SizeMode" Title="Select items"/>
    </div>
    <div class="card-body mw-480">
        <DxTagBox NullText="Select countries..."
                  Data="@CountryCity.Countries"
                  ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"
                  TextFieldName="@nameof(Country.CountryName)"
                  @bind-Values="@SelectedCountries"
                  SizeMode="SizeMode"></DxTagBox>
    </div>
</div>

<CodeSnippet_Editor_TagBox_NullText></CodeSnippet_Editor_TagBox_NullText>

@code {
    IEnumerable<Country> SelectedCountries { get; set; }
}
